nicer with MSVC.
* You may distribute this file under the terms of the Artistic
* License, as specified in the README file.
*
- * $Id: pdb.c,v 1.8 2005-10-13 22:08:01 robertl Exp $
+ * $Id: pdb.c,v 1.9 2006-02-20 21:59:19 robertl Exp $
*/
/* XXX - The way zero-length records are handled is a bit of a kludge. They
* shouldn't normally exist, with the exception of expunged records. But,
*/
#if defined (__WIN32__)
#include <io.h>
+#define lseek _lseek
+#define write _write
+#define read _read
+#define close _close
#else
#include <unistd.h>
#endif
offset = lseek(fd, 0L, SEEK_CUR); /* Find out where we are */
if (offset != db->appinfo_offset)
{
- if (offset > db->appinfo_offset)
+ if (offset > (off_t) db->appinfo_offset)
{
/* Oops! We're in the wrong place */
fprintf(stderr, _("Warning: AppInfo block in \"%.*s\" "
offset = lseek(fd, 0L, SEEK_CUR); /* Find out where we are */
if (offset != db->sortinfo_offset)
{
- if (offset > db->sortinfo_offset)
+ if (offset > (off_t) db->sortinfo_offset)
{
/* Oops! We're in the wrong place */
fprintf(stderr, _("Warning: sort block in \"%.*s\" "
/* Find out where we are now */
if (offset != rsrc->offset)
{
- if (offset > rsrc->offset)
+ if (offset > (off_t) rsrc->offset)
{
fprintf(stderr, _("Warning: resource %d in "
"\"%.*s\" isn't where "
/* Find out where we are now */
if (offset != rec->offset)
{
- if (offset > rec->offset)
+ if (offset > (off_t) rec->offset)
{
fprintf(stderr, _("Warning: record %d in "
"\"%.*s\" isn't where "
# define snprintf _snprintf
# define vsnprintf _vsnprintf
# define fileno _fileno
+# define strdup _strdup
#endif
/* Turn off numeric conversion warning */
*/
#include "defs.h"
+#include "jeeps/gpsmath.h"
static FILE *fd, *ofd;
static int indatum;
}
}
-static char *
+void
fwrite_fixedstring(FILE *fd, const char *str, int fieldlen)
{
int len = str ? strlen(str) : 0;
static void
gtm_rd_init(const char *fname)
{
- char buf[256];
int version;
char *name;
fd = xfopen(fname, "rb", MYNAME);
GPS_PPacket rec;
int16 version;
int16 id;
- char tstr[256];
if(!GPS_Serial_On(port, &fd))
return gps_errno;
GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon));
p+=sizeof(int32);
if (way->alt_is_unknown) {
- GPS_Util_Put_Float(p,1.0e25);
+ GPS_Util_Put_Float(p,(const float) 1.0e25);
} else {
GPS_Util_Put_Float(p,way->alt);
}
@echo.\r
CALL :COMPARE %TMPDIR%\gpx.gpx %TMPDIR%\gu.wpt\r
\r
+REM GTM\r
+DEL %TMPDIR%\gl.gpx %TMPDIR%\gpx.gpx\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i gtm -f reference\sample.gtm -o gpx -F %TMPDIR%\gtm1.gpx\r
+%PNAME% -i gpx -f %TMPDIR%\gtm1.gpx -o gtm -F %TMPDIR%\gtm.gtm\r
+%PNAME% -i gtm -f %TMPDIR%\gtm.gtm -o gpx -F %TMPDIR%\gtm2.gpx\r
+@echo off\r
+@echo.\r
+CALL :COMPARE %TMPDIR%\gtm1.gpx %TMPDIR%\gtm2.gpx\r
+CALL :COMPARE %TMPDIR%\gtm.gtm reference\sample.gtm\r
+\r
REM Magellan Mapsend\r
DEL %TMPDIR%\mm.mapsend %TMPDIR%\mm.gps\r
@echo on\r
Visual Studio .NET, you may be asked to convert them to the new format;
In that case, you should do so.
+Note that the "Microsoft Platform SDK" is required in addition to
+the actual compiler package. If you're using the Express editions,
+you must also reconfigure MSVC to use that as described at:
+ http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
+
The "Expat" directory contains the import library and header file for the
Expat DLL. This may or may not be the latest build of Expat; you might
want to check http://expat.sourceforge.net to see if there is a more recent
}
else
{
- queue *elem, *temp;
time_t prev;
+ queue *elem;
tm.tm_hour = 23; /* last date found */
tm.tm_min = 59;
if (wpt->centiseconds != 0)
{
time_t dt;
- struct tm time;
wpt->centiseconds = 0; /* reset flag */
}
fatal( "unrecognized color name %s\n", opt_color );
-
+ return -1;
}
int urlcol;
} unicsv_fieldpos;
-static float unicsv_altscale;
+static double unicsv_altscale;
static char *unicsv_fieldsep;
static
}
static void
-unicsv_rd()
+unicsv_rd(void)
{
char buff[1024];